#include "ThreadPool.hpp"
#include "Task.hpp"

int main()
{
    srand(time(nullptr)^getpid());
    // ThreadPool<Task> *tp = new ThreadPool<Task>();
   
    // tp->Start();
    ThreadPool<Task>::GetInstance()->Start();
    while(true)
    {
        int data1 = rand()%10+1;
        usleep(10);
        int data2 = rand()%5;
        char op = opers[rand()%opers.size()];
        Task t(data1,data2,op);
        usleep(10);
        // tp->Push(t);
        ThreadPool<Task>::GetInstance()->Push(t);
        std::cout<<"主线程启动：" << t.GetTask() <<std::endl;
        sleep(1);
    }
    return 0;
}